package com.demo.demo.multi_properties;

import com.demo.demo.TestConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author ayatsuji
 * @date 2021-06-13 23:03
 * @since
 */
//@Component
@ConfigurationProperties("multi")
public class MultiPropertiesDemo implements TestConfig.Show {
    private String name;
    private Integer age;
    private List<String> hobby;

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Override
    public void showAll() {
        logger.info("name={}", name);
        logger.info("age={}", age);
        logger.info("hobby={}", hobby);
    }

    void setName(String name) {
        this.name = name;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void setHobby(List<String> hobby) {
        this.hobby = hobby;
    }
}
